package com.sikadwafastdaisfondturbo.pretloan.utils.http

import org.json.JSONObject
import java.io.File

/**
 * Sikadwa
 *
 * @Author wwdeng
 * @CreateTime: 2024/5/20 17:56
 * @Annotation：网络请求帮助类
 */
object HttpHelper : IHttpLoader{

    private var mHttpLoader: IHttpLoader? = null

    fun init(httpLoader: IHttpLoader) {
        mHttpLoader = httpLoader
    }

    override fun get(url: String, callback: IHttpCallback) {
        mHttpLoader!!.get(url, callback);
    }

    override fun post(url: String, params: JSONObject, callback: IHttpCallback) {
        mHttpLoader!!.post(url, params, callback);
    }

    override fun addEvent(eventName: String,remark: String) {
        mHttpLoader!!.addEvent(eventName, remark)
    }

    override fun uploadFile(url: String, file: File, callback: IHttpCallback) {
        mHttpLoader!!.uploadFile(url,file,callback)
    }
}
